home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 6 / Amoszine 6 (Disk 1 of 2).adf / arts / Scroll.asc.cm / Scroll.asc.cm
Encoding:
Text File  |  1992-09-02  |  3.4 KB  |  113 lines

  1. @2}SCROLL ROUTINE
  2.  
  3.  
  4.  
  5. @3(Converted by Thomas Lancaster "Editor of MAG.E" from a 
  6. message originally posted in the AMOS echo of Fidonet).
  7.  
  8. @1
  9. >How is it possible to set a scroll routine going in the foreground 
  10. >and have other things happening in the foreground.
  11.  
  12. @4
  13. The only way you can do such a thing and leave it alone so that you can do
  14. other things, is to use interrupts. Seeing as you don't have much control
  15. over interrupts from AMOS, you cannot do it (normally). However, AMOS has
  16. AMAL, which DOES support interrupts (50 frames second).
  17. @1
  18. I'd suggest that you do the following:
  19. @4
  20. Open a large screen, like 960x256 or something. Then plot your scroll text
  21. onto the screen normally and wrap it around onto the next line when you get
  22. to 960-320 (320 is the display area size)...
  23.  
  24. @5
  25.  
  26.  
  27.  
  28.  
  29.  
  30. +-----------------------------------+-------------+
  31. |This is a test scroll text which will wrap around|
  32. |ll wrap around to the next line once you have rea|
  33. |e you have reached the end of the screen. By doin|
  34. |creen. By doing this you can use hardware scrolli|
  35. |rdware scrolling from AMAL - which will run on it|
  36. |will run on its own in the background, while you |
  37. |nd, which will run on its own while you do other |
  38. | you do other things.                            |
  39. +-----------------------------------+-------------+
  40. |                                   ^
  41. |                                  /|\
  42. |______\____________________________|
  43.        /                            [Display size ]
  44. Copy
  45. from
  46. here - - - - - - - - - - - - - - - -To here
  47.  
  48. @4
  49. Basically, if you want your screen (on the actual screen - what you can see)
  50. to be 320, then you subtract that from 960 (the screen width). That gives
  51. you 960-320 which is 640. Now, you plot your scroll text (in its entirity)
  52. on the screen, making sure that you wrap around to the next 'line' when you
  53. get to 640. How you do this wrapping around is up to you. If you get stuck,
  54. I will explain that part further. By 'line', i mean the next 'text' line. If
  55. your text is 8 pixels high, then the next line starts 8 pixels lower than
  56. the last one. Basically, what you will end up with is a screen full of text
  57. - a continuous message which wraps round when it reaches 640. Then you do
  58. the following instruction:
  59. @1
  60. Screen Copy    Screen,  0, 0, 640,  256  To    0, 640,  0
  61. @4
  62. which will copy the text from the left of the screen to position 640. This
  63. is necessary for the scrolling, because you want the scrolling to be
  64. seamless, and if you just jumpted to the next line when you reached the end
  65. of a line the text on-screen would suddelny get wiped and replaced with the
  66. next line.
  67.  
  68. Now..
  69. @1
  70. Screen Display    Screen,  128,  YLine,   320,  TextHeight
  71.  
  72. @4
  73. Where 'YLine' is the hardware line on which you want the text to be
  74. vertically (42 is the top of the screen), and 'TextHeight' is the height of
  75. each text line - maybe 8, maybe more - just enough to display the first line
  76. of text.
  77.  
  78. Then you do your amal.
  79.  
  80. @1
  81. Channel 1 to Screen Offset    Screen
  82.  
  83. @4
  84. - Where 'Screen' is the number of the screen (as in the previous
  85.   instructions).
  86.  
  87.  
  88. @1
  89. A$="For R0=0 To 255 Step 8; For R1=4 To 640 Step 4;"
  90. A$=A$+"Let X=R1; Let Y=R0; Pause; Next R1; Next R0;"
  91. Amal 1,A$
  92. Amal On
  93. @4
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. That will start the text scrolling. 'Step 8' is the height of a text
  104. line. 'R1=4' and 'Step 4' is the scroll speed. If you change 1, make sure
  105. you change the other. A scroll speed which is not exactly divisable by 640
  106. wont work. That's it, that should work. 
  107.  
  108. @5
  109. Paul West
  110.  
  111. @1
  112. End.
  113.